package com.cloud.servicefeign.web;

import com.cloud.servicefeign.clients.SchedualServiceHi;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * 服务 负载均衡 实现
 *
 * @author lcc
 * create 2018-08-09
 **/
@RestController
public class HiController {


    // 调用方法失败后的方法
    @Autowired
    SchedualServiceHi schedualServiceHi;
    @Value("${server.port}")
    String port;

    @GetMapping(value = "/hi")
    public String sayHi(@RequestParam String name) {
        return schedualServiceHi.sayHiFromClientOne( name,port );
    }
}